import { defHttp } from '/@/utils/http/axios';

interface IData {
	"id"?: string,
	"deptCode": string,
	"deptName": string,
	"deptAlias"?: string,
	"clinicAttr"?: string,
	"outpOrInp"?: string,
	"internalOrSergery"?: string,
	"sortCode"?: number,
	"status"?: boolean,
	"inputCode"?: string,
	"remark"?: string,
	"hospitalCode"?: string,
	"organizationId"?: string
}

enum Api {
	url = 'informations/pager',
	added = 'informations',
	dels = "informations"
}
// 列表
export function list(params) {
	return defHttp.get({ url: Api.url, params });
}
// 新增
export function add(data: IData) {
	return defHttp.post({ url: Api.added, data });
}
// 编辑
export function edit(id: string, data: IData) {
		return defHttp.put({ url: `informations/`+id+`/review`, data:{remark:data.remark,isPass:true} });
}
//重新发布
export function release(id: string, data: IData) {
	return defHttp.put({ url: `informations/`+id , data });
}
//撤回
export function draw(id: string, data: IData) {
	return defHttp.put({ url: `informations/`+id+`/withdraw`,data});
}
// 删除
export function del(id: string) {
	return defHttp.delete({ url: Api.dels, data: id });
}
export function orglist() {
	return defHttp.get({ url: Api.url });
}